package com.byref.liteflowdemo.cmp.order;

import com.yomahub.liteflow.core.NodeComponent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author BYREF
 */
@Slf4j
@Component("saveOrder")
public class SaveOrderCmp extends NodeComponent {
    @Override
    public void process() throws Exception {
        OrderContext orderContext = this.getContextBean(OrderContext.class);
        orderContext.setOrderId("orderId-" + System.currentTimeMillis());
        PriceContext priceContext = this.getContextBean(PriceContext.class);
        log.info("保存订单[orderContext: {}, priceContext: {}]", orderContext, priceContext);
    }
}
